package com.ruoyi.tb.lmt.service;

import cn.hutool.json.JSONArray;
import com.ruoyi.tb.lmt.domain.TbLmtrepairWorkdetail;
import com.ruoyi.tb.lmt.domain.TbRepairplanlist;
import com.ruoyi.tb.lmt.domain.bo.TbRepairplanlistBo;
import com.ruoyi.tb.lmt.domain.vo.*;
import com.ruoyi.tb.lmt.domain.bo.TbLmtrepairWorkdetailBo;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.core.domain.PageQuery;

import java.time.LocalDate;
import java.util.Collection;
import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * 检修工作Service接口
 *
 * @author ruoyi
 * @date 2023-12-14
 */
public interface ITbLmtrepairWorkdetailService {

    /**
     * 查询检修工作
     */
    TbLmtrepairWorkdetailVo queryById(Long id);

    /**
     * 查询检修工作列表
     */
    TableDataInfo<TbLmtrepairWorkdetailVo> queryPageList(TbLmtrepairWorkdetailBo bo, PageQuery pageQuery);

    /**
     * 查询检修工作列表
     */
    List<TbLmtrepairWorkdetailVo> queryList(TbLmtrepairWorkdetailBo bo);

    List<TbLmtrepairWorkdetailVo> queryListAndNotIds(String like,String like1,List<String> ids);

    /**
     * 新增检修工作
     */
    Boolean insertByBo(TbLmtrepairWorkdetailBo bo);

    Long insertByBoReturnId(TbLmtrepairWorkdetailBo bo);

    /**
     * 修改检修工作
     */
    Boolean updateByBo(TbLmtrepairWorkdetailBo bo);

    /**
     * 校验并批量删除检修工作信息
     */
    Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);

    Boolean startByBo(TbRepairplanlistBo bo);

    TableDataInfo<TbLmtrepairWorkdetailVo> selectWorkList(String id,String status,String workKind,String workCategory,String workName,String workRequire,String workGroup,PageQuery pageQuery);

    List<TbLmtrepairWorkdetailVo> selectWorkList(String id, String status, String lmtType,String lmtNumber,String repairChar);

    TableDataInfo<TbLmtrepairWorkdetailVo> selectWorkDispatchList(String id, String status,String workSelect, String lmtType,String lmtNumber,String repairChar,String workKind,PageQuery pageQuery);

    TableDataInfo<TbLmtrepairWorkdetailVo> selectWorkOverhaulList(String id, String status,String workSelect, String lmtType,String lmtNumber,String repairChar,String workCategory,PageQuery pageQuery);

    TableDataInfo<TbLegacyIssuesVo> selectWorkLegacyList(String id,String workSelect, String lmtType,String lmtNumber,String repairChar,PageQuery pageQuery);

    TableDataInfo<TbLmtrepairWorkdetailVo> selectWorkCheckList(String id,String workSelect, String lmtType,String lmtNumber,String repairChar,PageQuery pageQuery);

    TableDataInfo<TbLmtrepairWorkdetailVo> selectWorkApprovalList(String id,String workSelect, String lmtType,String lmtNumber,String repairChar,PageQuery pageQuery);

    List<TbLmtrepairWorkdetailVo> selectWorkHistoryList(String id, String workSelect, String lmtType, String lmtNumber, String repairChar);

    Boolean updateWork(TbLmtrepairWorkdetailBo bo);

    TableDataInfo<TbLmtrepairWorkdetailVo> selectWorkHistoryList(String id, String workKind, String workGroup, String workSelect, String status, Date startTime, PageQuery pageQuery);

    List<TbLmtrepairWorkdetailVo> selectHistoryList(String id, String workKind, String workGroup, String workSelect, String status, Date startTime);

    Map<String, Object> queryMapById(Long id);

    List<TbLmtrepairWorkdetailVo> selectWorkInfoList(Long id);

    TableDataInfo<TbLmtrepairWorkdetailVo> selectTaskAllById(String lmtRepairId,String lmtType,String lmtNumber,String status,String repairChar,PageQuery pageQuery);

    TableDataInfo<TbLmtrepairWorkdetailVo> selectLegacyById(String lmtRepairId,String lmtType,String lmtNumber,String status,String repairChar,PageQuery pageQuery);

    TableDataInfo<TbLmtrepairWorkdetailVo> selectMutualById(String lmtRepairId, String lmtType, String lmtNumber, String status, String repairChar, PageQuery pageQuery);

    TableDataInfo<TbLmtrepairWorkdetailVo> selectSpecialById(String lmtRepairId, String lmtType, String lmtNumber, String status, String repairChar, PageQuery pageQuery);

    TableDataInfo<TbLmtrepairWorkdetailVo> selectAcceptanceById(String lmtRepairId, String lmtType, String lmtNumber, String status, String repairChar, PageQuery pageQuery);

    //根据lmtRepairId判断是否工作都已经完成
    Boolean isFinishByLmtId(String lmtRepairId);

    Boolean isIssuesByLmtId(String lmtRepairId);

    TableDataInfo<TbDigitalLmtVo> selectDigitalLmt(String lmtNumber,PageQuery pageQuery);

    TableDataInfo<TbLmtrepairWorkdetailVo> selectIndexTest(String lmtType, String lmtNumber, String workType, String workGroup, Date startTime, Date endTime,PageQuery pageQuery);

    TableDataInfo<TbLmtrepairWorkdetailVo> selectIndexNotTest(String lmtType, String lmtNumber, String workType, String workGroup, Date startTime,Date endTime, PageQuery pageQuery);

    MessageTestVo selectMessage();

    TbLmtrepairWorkdetailVo selectWorkInfo(Long id);

    TbLmtrepairWorkdetailBo selectWorkInfoBo(Long id);

    HistoryDetailVo selectHistoryDetailList(Long lmtRepairId);

    JSONArray historyDetail2(Long lmtRepairId);

    MyTestCountVO selectMyTestVo();

    TableDataInfo<TbLmtrepairWorkdetailVo> selectIssuesWorkList(String lmtType, String lmtNumber, String workType, PageQuery pageQuery);

    TableDataInfo<EquipmentVo> selectEquipment(String lmtNumber, PageQuery pageQuery);

    TableDataInfo<TbLmtrepairWorkdetailVo> selectPickupList(PageQuery pageQuery);

    DigitalDateVo selectDate(String lmtNumber);

    AcceptCountVo selectAcceptCount();

    List<OilSampleDetectionVo> selectOilList(String lmtNumber);

    List<DrDamperDataVo> selectDrDamperList(String lmtNumber);

    TbRepairplanlist selectPlanInfo(Long lmtRepairId);

    TableDataInfo<TbLmtrepairWorkdetailVo> selectAcceptList(String status, PageQuery pageQuery);

    List<DeptVo> selectDeptVoList();

    List<DeptVo> selectUserList(Long deptId);

    TbLmtrepairWorkdetailVo selectWorkDetailData(String equipmentName, Long lmtRepairId);

    List<TaskStatsVo> getTaskStats(Date startDate, Date endDate);

    MyTestCountVO selectTestCount(String id);

    AcceptCountVo selectAcceptCountById(String id,String workSelect);

    TbLmtrepairWorkdetailBo selectByMutual(Long lmtRepairId);

    TableDataInfo<TbLegacyIssuesVo> selectUserIssuesWorkList(String lmtType, String lmtNumber, String workType, PageQuery pageQuery);

    TbDigitalLmtDataVo selectLmtData();

    EquipmentCountVO selectEquipmentCount();

    TbLmtrepairWorkdetailBo selectBySpecial(Long lmtRepairId);

    TbLmtrepairWorkdetailBo selectByAcceptance(Long lmtRepairId);

    TableDataInfo<TbLmtrepairWorkdetailVo> selectWorkList1(String status, String workKind, String workCategory, String workName, String workRequire, String workGroup,String workType, PageQuery pageQuery);

    TableDataInfo<TbLmtrepairWorkdetailVo> listWheelDiameter(TbLmtrepairWorkdetailBo bo, PageQuery pageQuery);

    int countByWeekAndWorkType(LocalDate date, String workType);

    TbLmtrepairWorkdetailVo selectByLmtTypeLmtNumberWorkCategoryWorkCategoryId(String lmtType, String lmtNumber, String workCategory, String workCategoryId,String status);

    TbLmtrepairWorkdetailVo selectTopOneByLmtNumberAndRepairChar(String lmtNumber, String workType);
    public List<WheelDiameterDataVo> getWheelDiameterDataList(String jsonStr);

    void updateByRepairIdsAndCategoryAndKind(TbLmtrepairWorkdetail workdetail, List<Long> repairIds);
    void updateByRepairIdsAndCategoryAndKind1(TbLmtrepairWorkdetail workdetail, List<Long> repairIds);

    List<TbLmtrepairWorkdetailVo> selectIndexTestExport(String lmtType, String lmtNumber, String workType, String workGroup, Date startTime,Date endTime);

    List<TbLmtrepairWorkdetailVo> selectIndexNotTestExport(String lmtType, String lmtNumber, String workType, String workGroup, Date startTime,Date endTime);


    void deleteByLmtRepairId(Long id);

    List<TbLmtrepairWorkdetailVo> queryByLmtRepairId(Long id);
}
